namespace CPlusPlusPlusPlus
{
    public class classAndStruct
    {
        /*记录与类和结构的区别
        
        */
        /*实例定义了一个公共记录，它使用的位置参数来声明和实例化记录，然后，它会输出类型的名称和属性值*/
        public record Person(string name,int age);

        public static void Main1(){
            Person person = new("Mancy",22);
            Console.WriteLine(person.ToString());
            Person person1 = new("Mancy",22);
            Console.WriteLine(person.Equals(person1));

            Console.WriteLine("person: "+person.GetHashCode());
            Console.WriteLine("person1: "+person1.GetHashCode());
        }
    }
}